/*剪辑 api */
import request from '@/utils/request';
import {object2Url} from "@/utils/trans";

// 获取所有AI
export async function aiList() {
  const ts = new Date().getTime();
  const ua = navigator.userAgent;
  const us = {
    ts,
    ua,
  };
  let url = `/business/montage/ailist/list${object2Url(us)}`
  const res = await request.get(url, us);
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

//获取AI配置
export async function aiConfig(data) {
  const res = await request.post('/business/montage/ailist/aiConfig', data);
  if (res.data.code === 2000) {
    return res.data.msg;
  }
  return Promise.reject(new Error(res.data.msg));
}

//获取所有滤镜
export async function getFilterList(data) {
  const res = await request.get('/business/montage/filterlist/all', data);
  if (res.data.code === 2000) {
    return res.data.msg;
  }
  return Promise.reject(new Error(res.data.msg));
}

//获取所有字体
export async function getFontList(data) {
  const res = await request.get('/business/montage/fontlist/all', data);
  if (res.data.code === 2000) {
    return res.data.msg;
  }
  return Promise.reject(new Error(res.data.msg));
}

//获取所有花字列表
export async function getTextList(data) {
  const res = await request.get('/business/montage/textlist/all', data);
  if (res.data.code === 2000) {
    return res.data.msg;
  }
  return Promise.reject(new Error(res.data.msg));
}

//获取所有转场效果
export async function getTransitionlist(data) {
  const res = await request.get('/business/montage/transitionlist/all', data);
  if (res.data.code === 2000) {
    return res.data.msg;
  }
  return Promise.reject(new Error(res.data.msg));
}


